package com.iwayin.core.bo.ask;

import java.util.List;

import com.iwayin.core.dataobject.AskDO;
import com.iwayin.core.dataobject.UserDO;
import com.iwayin.core.vo.SearchVO;

public interface AskBO {

	/**
	 * @author LiuWenLong
	 * @version 2012-3-7下午9:05:33
	 * @descriptions 添加问题
	 * @param ask
	 * @return
	 */
	Long addAsk(AskDO ask);

	/**
	 * @author harry
	 * @version
	 * @descriptions 删除问题
	 * @param ask
	 */
	void deleteAsk(AskDO ask);

	/**
	 * @author LiuWenLong
	 * @version 2012-3-6下午10:08:23
	 * @descriptions 查询问问题最多的用户(取前10位)
	 * @param AskDO
	 * @return
	 */
	List<UserDO> findHotAskUser(AskDO ask);

	/**
	 * @author LiuWenLong
	 * @version 2012-3-6下午10:08:28
	 * @descriptions 查询热门问题(取前10位)
	 * @param AskDO
	 * @return
	 */
	List<AskDO> findHotAsk(AskDO ask);

	/**
	 * @author LiuWenLong
	 * @version 2012-3-7下午8:25:59
	 * @descriptions 最新的问题(取前10位)
	 * @return
	 */
	List<AskDO> findLastestAsk(AskDO ask);

	/**
	 * @author ZhangLei
	 * @descriptions 获取用户所有ask信息
	 * @return
	 */
	List<AskDO> findUserAsks(AskDO ask);

	/**
	 * @author LiuWenLong
	 * @version 2012-3-8下午8:49:16
	 * @descriptions 查询关注的ask
	 * @param ask
	 * @return
	 */
	List<AskDO> findFollowAsk(AskDO ask);

	/**
	 * @author ZhangLei
	 * @descriptions 查询当天ask最多的用户
	 * @return
	 */
	List<UserDO> findAskMostToday(Long size);

	/**
	 * @author ZhangLei
	 * @descriptions 搜索ask
	 * @return
	 * 
	 */
	public List<SearchVO> searchAsks(SearchVO query);

	public List<AskDO> findNoLoginLastestAsk(AskDO ask);

	/**
	 * 未登录 ASK 详情
	 * @param id
	 * @return
	 */
	public AskDO askDetails(Long id);
	
	/**
	 * 已登录 ASK 详情
	 * @param ask
	 * @return
	 */
	public AskDO askDetails(Long askId, Long userId);


	public List<AskDO> prevNextAskDetails(Long id);
	/**
	 * 未登录用户ask查询
	 * @param ask
	 * @return
	 */
	public List<AskDO> findNoLoginUserAsk(AskDO ask);
	/**
	 * 查询用户投票的ask列表
	 * @param ask
	 * @return
	 */
	public List<AskDO> findUserVoteAsks(AskDO ask);
	
	/**
	 * 查询用户喜欢的ask列表
	 * @param ask
	 * @return
	 */
	public List<AskDO> findUserLikeAsks(AskDO ask);
	
	public List<AskDO> findTop5VoteOrLikeAsk(String orderBy);
 
}
